package com.library.service;

import com.library.entity.OaDepartmentUserLink;
import com.library.entity.OaDepartmentUserLinkExt;
import com.library.mapper.OaDepartmentUserLinkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author ido
 * @since 2024-12-14
 */
@Service
public class OaDepartmentUserLinkServiceImpl {

    @Autowired
    private OaDepartmentUserLinkMapper oaDepartmentUserLinkMapper;

    public List<OaDepartmentUserLinkExt> list(OaDepartmentUserLinkExt oaDepartmentUserLink) {
        List<OaDepartmentUserLinkExt> oaDepartmentUserLinkExts = oaDepartmentUserLinkMapper.listByQuery(oaDepartmentUserLink);
        return oaDepartmentUserLinkExts;
    }

    public void add(OaDepartmentUserLink oaDepartmentUserLink) {
        int insert = this.oaDepartmentUserLinkMapper.insert(oaDepartmentUserLink);
    }

    public void delete(OaDepartmentUserLink oaDepartmentUserLink) {
        this.oaDepartmentUserLinkMapper.deleteByPrimaryKey(oaDepartmentUserLink.getId());
    }

    public OaDepartmentUserLinkExt detail(OaDepartmentUserLink oaDepartmentUserLink) {
        OaDepartmentUserLinkExt oaDepartmentUserLink1 = this.oaDepartmentUserLinkMapper.selectByPrimaryKey(oaDepartmentUserLink.getId());
        return oaDepartmentUserLink1;
    }

    public void update(OaDepartmentUserLink oaDepartmentUserLink) {
        this.oaDepartmentUserLinkMapper.updateByPrimaryKeySelective(oaDepartmentUserLink);
    }
}
